package com.itheima.mOop;

/*
      teacher
 */
public class Teacher {
    //1.定义属性
    private String name;
    private String ID;
    //2.建立构造

    public Teacher() {
    }

    public Teacher(String name, String ID) {
        this.name = name;
        this.ID = ID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public void teach() {
        System.out.println("工号为" + ID + "的" + name + "老师正在讲课");
    }
}

class TestTeacher {
    public static void main(String[] args) {
        Teacher t1 = new Teacher();
        t1.setName("黄桂林");
        t1.setID("123456");
        Teacher t2 = new Teacher("小郑老师", "23234");
        t1.teach();
        t2.teach();
    }
}
